import pymysql


def log(func):
    def wrapper(sname):
        func(sname)
        connection = pymysql.connect(host="localhost",user="root",password="1234",port=3306,database="woniudb")
        cursor = connection.cursor()
        cursor.execute("insert into stustrg values('{}')".format(sname))
        connection.commit()
        cursor.close()
    return wrapper()